package org.rendao.utils
{
	import org.rendao.entity.UserRole;
	import org.rendao.service.base.GlobalModule;

	public class UserUtils
	{
		private static const ADMIN_ROLE:String = "管理员";
		
		public static function currentUserIsAdmin():Boolean {
			for(var i:int=0; i<GlobalModule.userDetail.roles.length; i++) {
				var role:UserRole = GlobalModule.userDetail.roles[i] as UserRole;
				if(role.name == ADMIN_ROLE) {
					return true;
				}
			}
			return false;
		}
	}
}